<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 计算 `1*2*3*4*……*100` 的乘积。
    var product = 1;
    for (var i = 1; i <= 100; i++) {
        product = i * product;
      }
      document.write(product);

      document.write("</br>")

    // 页面中输出 1+2+3+4+……+100 算式，并计算结果。
    var sum = 0;
    var sumStr = '';
    for (var j = 1; j <= 100; j++) {
      sum = sum + j;
      if (j == 100) {
        sumStr = sumStr + j + '=';
      } else {
        sumStr = sumStr + j + '+';
      }
    }
    document.write(sumStr + sum);
    document.write('<div style="word-break:break-all;">' + sumStr + sum + '</div>');
  </script>
</body>
</html>